<div class="row">
    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
        <div class="widget am-cf">
            <div class="widget-head am-cf">
                <div class="widget-title am-cf">商户订单管理</div>
                <!-- 工具栏 -->
                <div class="page_toolbar am-margin-bottom-xl am-cf">
                    <form id="form-search" class="toolbar-form" action="">
                        <input type="hidden" name="s" value="/<?= $request->pathinfo() ?>">
                        <div class="am fr">
                            <div class="am-form-group tpl-form-border-form am-fl">
                                <input type="text" name="start_time"
                                       class="am-form-field"
                                       value="<?= $request->get('start_time') ?>" placeholder="请选择起始日期"
                                       data-am-datepicker>
                            </div>
                            <div class="am-form-group tpl-form-border-form am-fl">
                                <input type="text" name="end_time"
                                       class="am-form-field"
                                       value="<?= $request->get('end_time') ?>" placeholder="请选择截止日期"
                                       data-am-datepicker>
                            </div>
                            <div class="am-form-group am-fl">
                                <div class="am-input-group am-input-group-sm tpl-form-border-form">
                                    <input type="text" class="am-form-field" name="search"
                                           placeholder="请输入商户名称"
                                           value="<?= $request->get('search') ?>">
                                    <div class="am-input-group-btn">
                                        <button class="am-btn am-btn-default am-icon-search" type="submit"></button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="am-scrollable-horizontal am-u-sm-12">
                    <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                        <thead>
                        <tr>
                            <th>商户名称</th>
                            <th>订单金额</th>
                            <th>支付方式</th>
                            <th>订单来源</th>
                            <th>付款人</th>
                            <th>支付时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        <?php if(!$list->isEmpty()):foreach($list as $item):?>
                            <tr>
                                <td class="am-text-middle">
                                    <p class="item-title"><?= $item['shop_name'] ?></p>
                                </td>
                                <td class="am-text-middle">
                                    <p class="item-title"><?= $item['amount'] ?></p>
                                </td>
                                <td class="am-text-middle">
                                    <p class="item-title"><?php if($item['pay_type']==10){ echo '余额支付';}else{ echo '微信支付';}  ?></p>
                                </td>
                                <td class="am-text-middle">
                                    <p class="item-title"><?php if($item['order_source']==10){ echo '普通订单';}elseif($item['order_source']==20){ echo '砍价订单';}elseif($item['order_source']==30){ echo '秒杀订单';}elseif($item['order_source']==40){ echo '购买储值卡订单';}elseif($item['order_source']==50){ echo '当面付订单';}  ?></p>
                                </td>
                                <td class="am-text-middle">
                                    <p class="item-title"><?=$item['nickName']  ?></p>
                                </td>
                                <td class="am-text-middle"><?= format_time((int)$item['create_time']) ?></td>
                                <td class="am-text-middle">
                                    <div class="tpl-table-black-operation">
                                        <a class="tpl-table-black-operation-green"
                                           href="<?= url('customer.customer/detail', ['order_id' => $item['order_id']]) ?>">
                                            订单详情</a>
                                    </div>
                                </td>
                            </tr>
                        <?php endforeach; else: ?>
                            <tr>
                                <td colspan="4" class="am-text-center">暂无记录</td>
                            </tr>
                        <?php endif; ?>
                        </tbody>
                    </table>
                </div>
                <div class="am-u-lg-12 am-cf">
                    <div class="am-fr"><?= $list->render() ?> </div>
                    <div class="am-fr pagination-total am-margin-right">
                        <div class="am-vertical-align-middle">总记录：<?= $list->total() ?></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    function getInformation(title,url){
        console.log(url)
        $('.j-delete').getinfo(title+"详情",url);
    }
</script>
